<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        console.log('x'.padStart(5, 'ab'));
        console.log('x'.padStart(4, 'ab'));
        console.log('x'.padEnd(5, 'ab'));
        console.log('x'.padEnd(4, 'ab'));
        // ababx abax xabab xaba
        console.log('xxxx'.padStart(4, 'ab'));  // 'xxxx'
        console.log('xxxx'.padEnd(4, 'ab'));  // 'xxxx'
        console.log('abc'.padStart(10, '0123456789'));  // '0123456abc'
        console.log('x'.padStart(5));  // '    x'
        console.log('x'.padEnd(5));  // 'x    '
        console.log('09-12'.padStart(10, 'YYYY-MM-DD'));  // "YYYY-09-12"
    </script>
</body>
</html>